<include file="Base/header" />
<link href="__PUBLIC__/baidujs/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="__PUBLIC__/baidujs/lang/zh-cn/zh-cn.js"></script>
<div class="page-container">
    <include file="Base/menu" />
    <div class="page-content">
        <div class="container-fluid">
            <div class="row-fluid">
                    <div class="span12">
                        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                        <h3 class="page-title">
                        </h3>
                        <ul class="breadcrumb">
                            <li>
                                <i class="icon-home"></i>
                                <a href="#">首页</a>
                                <i class="icon-angle-right"></i>
                            </li>
                            <li><a href="#">文章新增</a></li>
                        </ul>
                        <!-- END PAGE TITLE & BREADCRUMB-->
                    </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <div class="portlet box blue tabbable">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-reorder"></i>
                                <span class="hidden-480">增加</span>
                            </div>
                        </div>

                    <div class="portlet-body form">
                            <form method="post" class="form-horizontal" enctype="multipart/form-data">
                                    <div class="control-group">
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">
                                            标题
                                        </label>
                                        <div class="controls">
                                            <input type="text" placeholder="" class="m-wrap large" name="title" required="required">
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">
                                                栏目
                                        </label>
                                        <div class="controls">
                                            <select placeholder="" class="m-wrap large" name="a_id">
                                                <foreach name="data" item="vo">
                                                    <option value="{$vo.id}">
                                                       {$vo.title}
                                                    </option>
                                                </foreach>
                                            </select>
                                            <span class="help-inline">
                                                    请选栏目
                                            </span>
                                        </div>
                                    </div>
                          
                                    <div class="control-group">
                                        <label class="control-label">
                                                资讯内容
                                        </label>
                                        <div class="controls">
                                        <div class="row-fluid">
                                            <div class="span8"><!-- 加载编辑器的容器 -->
                                            <textarea id="myEditor" class="m-wrap" name='content'  type="text/plain" style='width:100%;height:450px;overflow:hidden;'></textarea>
                                            </div>
                                        </div>
                                        
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <button type="submit" class="btn blue">
                                                <i class="icon-ok">
                                                </i>
                                                保存
                                        </button>
                                    </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
    $("#submit").click(function(){
        var url = "{:U('Article/save')}"
        var data = $("#commentForm").serializeArray();
        var postData = {};
        $(data).each(function(i){
            postData[this.name] = this.value;
        });
        $.post(url,postData,function(result){
            if(result.status==1){
                //成功
                return dialog.success(result.message,result.data);
            }else if(result.status==0){
                //失败
                return dialog.error(result.message);
            }
        },"JSON");
        return false;
    });
</script>
<include file="Base/footer" />